<?php
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class CompLogo extends Page
{
       public $hfLogo = null;
       public $imgLogo = null;
       function imgLogoJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       parent.document.getElementById('JTFrameMain').src = "register_company_edit.php";
       <?php

       }

       function CompLogoJSLoad($sender, $params)
       {

       ?>
       //Add your javascript code here
       var logo=document.getElementById('hfLogo').value;
       //alert(logo);
       if(logo=='')
       {
       document.images['imgLogo'].src="image/amps_logo.png";
       }
       if(logo!='')
       {
       document.images['imgLogo'].src=logo;
       }
       <?php

       }

       function CompLogoCreate($sender, $params)
       {
       $result_comp = mysql_query("select * from company_tbl where company_id='".$_SESSION['company_id']."'")or die("company".mysql_error());
       $row_comp = mysql_fetch_array($result_comp);
       $comp = $row_comp['photo'];

       $this->hfLogo->setValue($comp);


       }

}

global $application;

global $CompLogo;

//Creates the form
$CompLogo=new CompLogo($application);

//Read from resource file
$CompLogo->loadResource(__FILE__);

//Shows the form
$CompLogo->show();

?>